﻿#pragma once

#include "App/Window.h"
#include "App/Gui.h"
#include "Core/ConfigArgs.h"

class CORE_API Application
{
public:
  Application(const AppArgs &args);
  virtual ~Application();
  void Run();

  Ref<Window> GetWindow() { return m_window; }
  float GetDeltaTime() const { return m_deltaTime; }

  virtual void OnInit() {};
  virtual void OnUpdate(float deltaTime) {};
  virtual void OnRender() {};
  virtual void OnRenderGui() {};
  virtual void OnShutdown() {};

protected:
  void InitApp();
  void MainLoop();
  void Shutdown();

  AppArgs m_args;

  Ref<Window> m_window = nullptr;
  Ref<Gui> m_gui = nullptr;

  float m_deltaTime = 0.0f;
  bool m_running = true;
};